import Vue from 'vue'
import VueRouter from 'vue-router'
import MainIndex from '../views/MainIndex.vue'

Vue.use(VueRouter)


// hideHeader: true, //隐藏头
const routes = [
  {
    path: '/details',
    name: 'detailmain',
    component: () => import('../views/DetailMain.vue'),
  },
  {
    path: '/',
    name: 'home',
    component: MainIndex
  },
  {
    path: '/search',
    name: 'search',
    component: () => import('../views/Search.vue'),
  },
  {
    path: '/register',
    name: 'register',
    component: () => import('../views/Register.vue'),
    meta: {
      title: '登录页'
    }
  },
  {
    path: '/index_product',
    name: 'Index',
    component: () => import('../views/Index_product.vue'),
    // meta: 元数据 -- 用于存储自定义的属性
    meta: {
      hideHeader: true,
      title: '商品主页'
    }
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('../views/Login.vue'),
  },
  {
    path: '/we',
    name: 'routeName',
    component: () => import('../views/Index_we.vue'),
  },
  {
    path: '/support',
    name: 'routeName',
    component: () => import('../views/supporView.vue'),
  },
  {
    path: '/indexView',
    name: 'routeName',
    component: () => import('../views/IndexView.vue'),
  }, {
    path: '/cart_index',
    name: 'Cart_index',
    component: () => import('../views/cartIndex.vue'),
  },
  {
    path: '/cart_index',
    name: 'Cart_index',
    component: () => import('../views/cartIndex.vue'),
  }, {
    path: '/searchPage',
    name: 'routeName',
    component: () => import('../views/SearchPage.vue'),
  },
]



const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
